package com.xxbb.chapter_8.dome2;

import com.xxbb.util.tool.Tool;

import java.io.PrintWriter;

/**
 * 多线程
 */
public class MyThread extends Thread {

    public MyThread() {
    }

    private String name = null;

    public MyThread(String name) {

        this.name = name;
    }

    @Override
    public void run() {
        Tool.println("子线程执行");
        for (int i = 0; i < 3; i++) {
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            ;
            Tool.println("子线程：" + name);
        }
    }
}
